package com.jeespring.user.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jeespring.user.dao.UserDao;
import com.jeespring.user.entity.User;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @title:
 * @description:
 * @author: 张朝阳
 * @date: 2019/12/20 13:08
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
    public PageInfo findPage(User user ,int pageNum, int pageSize){
        PageHelper.startPage(pageNum, pageSize);
        List<User> userList = userDao.select(user);
        PageInfo<User> pageInfo = new PageInfo<>(userList);
        return pageInfo;
    }
}
